<!doctype html>
<html lang="zh-cn">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
  <link rel="shortcut icon" href="../src/favicon.png">
  <title>plantuml themes</title>
  <style>
    * {
      margin: 0;
      box-sizing: border-box;
    }

    body {
      overflow-x: hidden;
    }

    #themes-box {
      display: -webkit-flex;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-items:center;
      margin-bottom: 50px;
    }

    .theme-item {
      text-align: center;
      display:flex ;
      flex-flow:column;
      align-self: flex-start;
      width: 160px;
      margin: 10px;
    }

    img {
      display: block;
      margin: 10px 0px;
    }

    img:not(:last-child) {
      margin-bottom: 50px;
    }
    footer {
      position: fixed;
      left: 0;
      bottom: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 50px;
      background: #222;
    }
    footer a {
      padding: 12px 4px;
      text-shadow: none;
      text-decoration: none;
      color: #fff;
    }
  </style>
</head>

<body>
  <div id="themes-box">
  </div>
  <footer>
    <a href="../">在线编辑器</a>
  </footer>
  <script src="../src/jquery.min.js"></script>
  <script src="../src/rawdeflate.js"></script>
  <script src="../src/encode.js"></script>
  <script src="../src/setting.js"></script>
  <script>
    $(function () {
      // 显示皮肤实例
      for (var i = 0; i < THEMES.length; i++) {
        var themeItem = '<div class="theme-item">';
        themeItem += '<h3>' + THEMES[i] + '</h3>';
        themeItem += setUml(THEMES[i])
        themeItem += '</div>';
        $('#themes-box').append(themeItem)
      }
      function setUml(theme) {
        var v = '!theme ' + theme + '\n';
        v += 'start\n';
        v += 'if (condition?) then (Y)\n';
        v += ':Yes;\n';
        v += 'endif\n';
        v += 'stop\n';
        v = encodeUml(v);
        return '<img src="' + PLANTUML_SERVER + v + '" />';
      }
    });
  </script>
</body>

</html>